In a moving picture encoding scheme using motion compensation as exemplified by H.264, predictive encoding of a motion vector is performed in order to efficiently encode the motion vector.
FIG. 10 illustrates an example of a configuration of a motion compensation unit in a conventional moving picture encoding apparatus. A motion compensation unit 100 in the conventional moving picture encoding apparatus is provided with a motion search unit 101, a motion vector memory 102, a motion vector prediction unit 103, and a prediction residual calculation unit 104.
If a video signal of a block to be encoded is input, the motion search unit 101 performs a motion search by collating it with a decoded signal of an encoded reference picture, calculates a motion vector, and stores it in the motion vector memory 102. The motion vector prediction unit 103 reads motion vectors that have been used in encoding of encoded blocks around the block to be encoded from the motion vector memory 102, and calculates a predictive motion vector using them as reference motion vectors. The prediction residual calculation unit 104 calculates the residual between the motion vector calculated by the motion search unit 101 and the predictive motion vector calculated by the motion vector prediction unit 103, and outputs a motion vector prediction residual. This motion vector prediction residual is encoded and output as encoded information of the motion vector.
FIG. 11 illustrates an example of a configuration of a motion compensation unit in a conventional moving picture decoding apparatus. A motion compensation unit 200 in the conventional moving picture decoding apparatus is provided with a motion vector calculation unit 201, a predictive signal creation unit 202, a motion vector memory 203, and a motion vector prediction unit 204.
The motion vector calculation unit 201 generates a motion vector by adding a motion vector prediction residual decoded from an encoded stream to a predictive motion vector predicted by the motion vector prediction unit 204, stores this motion vector in the motion vector memory 203, and outputs it to the predictive signal creation unit 202. The predictive signal creation unit 202 reads a decoded signal from a decoded reference picture in accordance with the motion vector, and outputs it as a prediction signal of a block to be decoded. The motion vector prediction unit 204 reads motion vectors that have been used in decoding of decoded blocks around the block to be decoded from the motion vector memory 203, and calculates the predictive motion vector using them as reference motion vectors.
Technology related to the above-mentioned motion vector predictive encoding includes the following conventional technology.
(a) Median predictive encoding (H.264 and the like) [hereinafter referred to as conventional technology a]
(b) Predictive encoding based on reference motion vector designation [hereinafter referred to as conventional technology b]
FIG. 12 is a diagram for explaining an example of a conventional predictive encoding scheme of a motion vector. In the conventional technology a and the conventional technology b, when encoding a motion vector (decoding is the same), prediction is performed using motion vectors of encoded blocks (encoded motion vectors) around a block to be encoded as illustrated in FIG. 12 as reference motion vectors, and the motion vector is encoded.
Specifically, in the conventional technology a, the median of the reference motion vectors is used as a predictive motion vector, and an error (referred to as a motion vector prediction residual) between a motion vector of the block to be encoded and the predictive motion vector is encoded (refer to Non-Patent Document 1).
Moreover, in the conventional technology b, an encoding apparatus (an encoder) selects a motion vector to be used in prediction from the reference motion vectors, and encodes an identifier of a reference motion vector to be used in prediction together with a motion vector prediction residual (refer to Non-Patent Document 2).
Furthermore, conventionally, as technology for predicting the motion vector itself of the block to be encoded instead of obtaining the motion vector prediction residual and encoding the motion vector, there is technology for predicting a motion vector based on template matching (hereinafter referred to as conventional technology c). This conventional technology c is a motion vector prediction method for performing motion compensation without encoding a motion vector at an encoding side (refer to Non-Patent Document 3).
FIG. 13 is a diagram for explaining conventional motion vector prediction based on template matching. In the conventional technology c, and in the case of predicting the motion vector of the block to be encoded, by using a set (this is called a template) of encoded pixels around the block to be encoded as illustrated by a reverse L-shaped area in FIG. 13, a motion search is performed in a predetermined search range on a reference picture (this process is called template matching). Specifically, the search is performed for each motion vector in the predetermined search range by calculating the degree of similarity, such as a sum of absolute differences (SAD), between the template and an area (called a matching area) obtained by shifting an area on the reference picture in the same position as the template by the motion vector. Motion compensation is performed using the resultant motion vector. Since it is also possible for a decoding side to perform the same process with a template which is a set of decoded pixels, it is advantageous in that motion compensation is possible without encoding the motion vector.